package java1_variablesPKG;

class Point {
	int x, y;
	Point() { System.out.println("default"); }
	Point(int x, int y) { this.x = x; this.y = y; }

	/* A Point instance is explicitly created at 
       class initialization time: */
	static Point origin = new Point(1,8);

	/* A String can be implicitly created 
       by a + operator: */
	public String toString() { return "(" + x + "," + y + ")"; }
}

	public class ClassReferenceExample {
	public static void main(String[] args) {
		/* An array is implicitly created 
           by an array constructor: */
		Point a[] = { new Point(2,0), new Point(1,3) };

		/* A Point is explicitly created
        using newInstance: */
		Point p = null;
		try {
			p = (Point)Class.forName("java1_variablesPKG.Point").newInstance();
		} catch (Exception e) {
			System.out.println(e);
		}

		/* Strings are implicitly created 
           by + operators: */
		System.out.println("p: " + p);
		System.out.println("a: { " + a[0] + ", " + a[1] + " }");

		/* An array is explicitly created
           by an array creation expression: */
		String sa[] = new String[2];
		sa[0] = "he"; sa[1] = "llo";
		System.out.println(sa[0] + sa[1]);
	}
}